import { renderStart } from '@/model/type'
export const columns = context => {
  return [
    {
      prop: 'customerName',
      label: '客户名称'
    },
    {
      label: '客户级别',
      render: (h, row) => {
        return <div class="text-warning fs16">{renderStart(row.customerStar)}</div>
      }
    },
    {
      label: '所属行业',
      prop: 'tradeType'
    },
    {
      label: '客户类型',
      prop: 'customerType'
    },
    {
      prop: 'customerSource',
      label: '客户来源'
    },

    {
      prop: 'createTime',
      label: '创建时间'
    },
    {
      prop: 'realName',
      label: '前归属人'
    },
    {
      prop: 'publicTime',
      label: '流入公海时间'
    },
    {
      prop: 'publicDay',
      label: '公海天数'
    },
    {
      button: true,
      label: '操作',
      fixed: 'right',
      width: 200,
      render: (h, row) => {
        const receive = (
          <a
            href="javascript:;"
            class="text-primary"
            onClick={() => {
              context.onReceive('single', row)
            }}
          >
            领取客户
          </a>
        )

        const detail = (
          <a
            href="javascript:;"
            class="text-primary"
            onClick={() => {
              context.onDetail(row)
            }}
          >
            详情
          </a>
        )
        return [receive, detail]
      }
    }
  ]
}
